# Ratings: <strong><%=@total%></strong> &nbsp; &nbsp; &nbsp;
# Sideffects: <strong><%= @sideffects.length%> </strong>

<table width="100%" border="1" >
  <tr>
    <td>
      <%= link_to_remote("Sideffect", :url => {:action => "sort_category_sideffects_by_name"}, :update => "category_sideffects", :complete => "$('details').innerHTML = '<strong>Click Sideffect to Show Detail</strong>'") %>
    </td>
    <td>
      <%= link_to_remote("Frequency", :url => {:action => "sort_category_sideffects_by_frequency"}, :update => "category_sideffects", :complete => "$('details').innerHTML='<strong>Click Sideffect to Show Detail</strong>'") %>
    </td>
  </tr>
    <% @sideffects.each do |sf| %>
      <tr>
        <td align="left" > 
          <strong><%= link_to_remote(h(sf["name"]), :url => {:action => "show_details", :id => sf["id"]}, :update => "details") %></strong>
        </td>
        <td align="right">
          <strong><%= sprintf("%2.2f", 100 * sf["cnt"].to_f / @total) + "%" %></strong>
        </td>
      </tr>
    <% end %>
  </table>
